<template>
	<view :style="themeColor">
		<view class="page">
			<view
				class="flex benben-position-layout flex flex-wrap align-center buyOffline_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }"
			>
				<view class='flex flex-wrap align-center justify-between flex-sub buyOffline_fd0_0'>
					<view
						class='flex flex-wrap align-center buyOffline_fd0_0_c0'
						@tap.stop="handleJumpDiy"
						data-type="back"
						data-url="1"
					>
						<text class='fu-iconfont2  buyOffline_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
					</view>
					<view class='flex flex-wrap align-center justify-end buyOffline_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<view
				class="loading_css"
				v-if="isShow"
			>
				<u-loading
					size="36"
					color="#AD3823"
				></u-loading>
				<view>加载中</view>
			</view>

			<!---flex布局flex布局开始-->
			<view
				class="flex flex-direction flex-wrap align-stretch benben-flex-layout buyOffline_flex_1"
				v-else
			>
				<view class='flex flex-wrap align-center buyOffline_fd1_0'>
					<text class='buyOffline_fd1_0_c0'>亲子国潮小剧</text>
				</view>
				<view class='flex flex-direction flex-wrap align-stretch buyOffline_fd1_1'>
					<view
						class='flex flex-wrap align-center buyOffline_fd1_1_c0'
						v-for="(v, k) in list"
						:key="k"
						@tap.stop="goStudy(v.aid, v.name, v.status, k)"
					>
						<view class='flex flex-direction flex-wrap align-stretch'>
							<text class='buyOffline_fd1_1_c0_c0_c0'>{{v.name}}</text>
							<text
								class='buyOffline_fd1_1_c0_c0_c1'
								v-if="v.status == 0"
							>去学习</text>
							<text
								class='buyOffline_fd1_1_c0_c0_c1'
								v-if="v.status == 1"
							>正在学习</text>
							<text
								class='buyOffline_fd1_1_c0_c0_c1'
								v-if="v.status == 2"
							>已完成</text>
						</view>
						<image
							v-if="v.status == 0"
							class='buyOffline_fd1_1_c0_c1'
							mode="aspectFill"
							:src='STATIC_URL+"534.png"'
						></image>
						<view v-if="v.status == 1">
							<l-liquid
								:current.sync="modelVale"
								size="40px"
								:percent="v.progress"
								outline
							>
								<text style="font-size: 32rpx;color: #BAC67F;font-family: Alimama DongFangDaKai;">{{v.progress}}</text>
								<text style="font-size: 24rpx;color: #BAC67F;font-family: Alimama DongFangDaKai;">%</text>
							</l-liquid>
						</view>
						<image
							v-if="v.status == 2"
							class='buyOffline_fd1_1_c0_c1'
							mode="aspectFill"
							:src='STATIC_URL+"527.png"'
						></image>
					</view>

				</view>
			</view>

			<!---flex布局flex布局结束-->
			<benben-popup
				v-model="popupShow1698288420002"
				:mask="true"
				:mask-close-able="true"
				mode='center'
				:z-index='999'
			>
				<!---flex布局flex布局开始-->
				<view class="flex benben-flex-layout flex-wrap align-center">
					<view class='flex flex-direction flex-wrap align-stretch buyOffline_fd2_0' style="font-family: Alimama DongFangDaKai;">
						<view class='flex flex-direction flex-wrap align-center'>
							<text class='buyOffline_fd2_0_c0_c0'>您好，同学</text>
							<text class='buyOffline_fd2_0_c0_c1'>确定解锁此阶段学习吗？</text>
							<view class='flex flex-wrap align-center buyOffline_fd2_0_c0_c2'>
								<view
									class='flex flex-wrap align-center justify-center buyOffline_fd2_0_c0_c2_c0'
									@tap.stop="popupShow1698288420002=false"
								>
									<text class='buyOffline_fd2_0_c0_c2_c0_c0'>取消</text>
								</view>
								<view
									class='flex flex-wrap align-center justify-center buyOffline_fd2_0_c0_c2_c1'
									@tap.stop="confirmStudy"
								>
									<text class='buyOffline_fd2_0_c0_c2_c1_c0'>确认</text>
								</view>
							</view>
						</view>
					</view>
				</view>

				<!---flex布局flex布局结束-->

			</benben-popup>
			<benben-popup
				v-model="popupShow1698289179736"
				:mask="true"
				:mask-close-able="true"
				mode='center'
				:z-index='999'
			>
				<!---flex布局flex布局开始-->
				<view class="flex benben-flex-layout flex-wrap align-center">
					<view class='flex flex-direction flex-wrap align-stretch buyOffline_fd3_0' style="font-family: Alimama DongFangDaKai;">
						<view class='flex flex-direction flex-wrap align-center'>
							<text class='buyOffline_fd3_0_c0_c0'>您好，同学</text>
							<text class='buyOffline_fd3_0_c0_c1'>当前阶段暂未解锁
								请解锁后再继续学习</text>
							<view class='flex flex-wrap align-center buyOffline_fd3_0_c0_c2'>
								<view
									class='flex flex-wrap align-center justify-center buyOffline_fd3_0_c0_c2_c0'
									@tap.stop="popupShow1698289179736=false"
								>
									<text class='buyOffline_fd3_0_c0_c2_c0_c0'>取消</text>
								</view>
								<view
									class='flex flex-wrap align-center justify-center buyOffline_fd3_0_c0_c2_c1'
									@tap.stop="popupShow1698289179736=false"
								>
									<text class='buyOffline_fd3_0_c0_c2_c1_c0'>确认</text>
								</view>
							</view>
						</view>
					</view>
				</view>
			</benben-popup>
		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				"popupShow1698289179736": false,
				"popupShow1698288420002": false,
				"popupShow1698288420003": false,
				"order_sn": "",
				"isShow": true,
				"list": [],
				"modelVale": 0,
				"aid": "",
				"name": "",
				"status": "",
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			let {
				order_sn
			} = options
			if (order_sn !== undefined) this.order_sn = order_sn;
			global.course_order = this.order_sn;
			this.getData();
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			// 已购买过的课程  65556ddfec3be
			getData() {
				this.$api.post(global.API_VERSION + '65556ddfec3be', {
					order_sn: this.order_sn
				}).then(res => {
					this.isShow = false;
					if (res.data.code == 1) {
						this.list = res.data.data;
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			goStudy(aid, name, status, index) {
				this.aid = aid;
				this.name = name;
				this.status = status;
				if (this.list[index].status == 1 || this.list[index].status == 2) {
					uni.navigateTo({
						url: '/pages/shouye/stageTheatre/stageTheatre?aid=' + this.aid + '&status=' + this.status
					})
				} else if (this.list[index].status == 0) {
					let index = -1;
					this.list.forEach((v, k) => {
						if (v.status == 1) {
							index = k;
						}
					})
					if (index != -1) {
						this.popupShow1698289179736 = true;
						return;
					} else {
						this.popupShow1698288420002 = true;
					}
				}
			},
			confirmStudy() {
				this.popupShow1698288420002 = false;
				uni.navigateTo({
					url: '/pages/shouye/stageTheatre/stageTheatre?aid=' + this.aid + '&name=' + this.name + '&status=' + this.status
				})
				// uni.navigateTo({
				// 	url: '/pages/shouye/toLearn/toLearn?aid=' + this.aid
				// })
			},
		}
	};
</script>
<style
	lang="scss"
	scoped
>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: url(https://www.guochaoxiaoju.com/uploads/mini/525.png) no-repeat;
		background-size: 100% 100%;
	}

	.buyOffline_flex_0 {
		/* background: url(https://www.guochaoxiaoju.com/uploads/mini/525.png) no-repeat; */
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		/* background-size: 100% auto !important; */
	}

	.buyOffline_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: var(--benbenFontColor3);
	}

	.buyOffline_fd0_0_c0 {
		width: 120rpx;
	}

	.buyOffline_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.buyOffline_flex_1 {
		padding: 24rpx 30rpx 0rpx 30rpx;
	}

	.buyOffline_fd1_1_c5 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/532.png) no-repeat;
		background-size: 100% auto;
		padding: 15rpx 32rpx 20rpx 25rpx;
		border-radius: 16rpx;
		margin: 0rpx 0rpx 24rpx 0rpx;
	}

	.buyOffline_fd1_1_c4 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/531.png) no-repeat;
		background-size: 100% auto;
		padding: 15rpx 32rpx 20rpx 25rpx;
		border-radius: 16rpx;
		margin: 0rpx 0rpx 24rpx 0rpx;
	}

	.buyOffline_fd1_1_c3 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/530.png) no-repeat;
		background-size: 100% auto;
		padding: 15rpx 32rpx 20rpx 25rpx;
		border-radius: 16rpx;
		margin: 0rpx 0rpx 24rpx 0rpx;
	}

	.buyOffline_fd1_1_c2 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/529.png) no-repeat;
		background-size: 100% auto;
		padding: 15rpx 32rpx 20rpx 25rpx;
		border-radius: 16rpx;
		margin: 0rpx 0rpx 24rpx 0rpx;
	}

	.buyOffline_fd1_1_c1 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/528.png) no-repeat;
		background-size: 100% auto;
		padding: 15rpx 32rpx 20rpx 25rpx;
		border-radius: 16rpx;
		margin: 0rpx 0rpx 24rpx 0rpx;
	}

	.buyOffline_fd1_1_c0_c1 {
		width: 78rpx;
		height: 78rpx;
		border-radius: 39rpx;
		margin: 0rpx 0rpx 0rpx auto;
	}

	.buyOffline_fd1_1_c0_c0_c1 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 400;
		margin: 10rpx 0rpx 0rpx 0rpx;
	}

	.buyOffline_fd1_1_c0_c0_c0 {
		color: #333333;
		font-size: 48rpx;
		font-weight: 400;
	}

	.buyOffline_fd1_1_c0 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/526.png) no-repeat;
		background-size: 100% auto;
		padding: 15rpx 32rpx 20rpx 25rpx;
		border-radius: 16rpx;
		margin: 0rpx 0rpx 24rpx 0rpx;
	}

	.buyOffline_fd1_1 {
		border: 2px solid #AD3823;
		background: #FFFFFF;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		width: 690rpx;
		box-shadow: 0rpx 0rpx 20rpx 1rpx rgba(0, 0, 0, 0.16), inset 0rpx 0rpx 16rpx 1rpx #AD3823;
		padding: 32rpx 24rpx 0rpx 24rpx;
	}

	.buyOffline_fd1_0_c0 {
		color: #FFFFFF;
		font-size: 64rpx;
		font-weight: 400;
	}

	.buyOffline_fd1_0 {
		margin: 0rpx 0rpx 56rpx 0rpx;
	}

	.buyOffline_fd2_0_c0_c2_c1_c0 {
		color: #FFFFFF;
		font-size: 34rpx;
		font-weight: 400;
	}

	.buyOffline_fd2_0_c0_c2_c1 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/694.png) no-repeat;
		height: 71rpx;
		width: 191rpx;
		margin: 0rpx 0rpx 0rpx 16rpx;
		background-size: 100% auto;
	}

	.buyOffline_fd2_0_c0_c2_c0_c0 {
		color: #796446;
		font-size: 34rpx;
		font-weight: 400;
	}

	.buyOffline_fd2_0_c0_c2_c0 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/693.png) no-repeat;
		height: 71rpx;
		width: 191rpx;
		margin: 0rpx 16rpx 0rpx 0rpx;
		background-size: 100% auto;
	}

	.buyOffline_fd2_0_c0_c2 {
		margin: 0rpx 0rpx 70rpx 0rpx;
	}

	.buyOffline_fd2_0_c0_c1 {
		line-height: 44rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
		margin: 40rpx 0rpx 71rpx 0rpx;
		text-align: center;
	}

	.buyOffline_fd2_0_c0_c0 {
		color: #333333;
		font-size: 40rpx;
		font-weight: 400;
		margin: 190rpx 0rpx 0rpx 0rpx;
	}

	.buyOffline_fd2_0 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/692.png) no-repeat;
		width: 580rpx;
		background-size: 100% auto;
	}

	.buyOffline_fd3_0_c0_c2_c1_c0 {
		color: #FFFFFF;
		font-size: 34rpx;
		font-weight: 400;
	}

	.buyOffline_fd3_0_c0_c2_c1 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/694.png) no-repeat;
		height: 71rpx;
		width: 191rpx;
		margin: 0rpx 0rpx 0rpx 16rpx;
		background-size: 100% auto;
	}

	.buyOffline_fd3_0_c0_c2_c0_c0 {
		color: #796446;
		font-size: 34rpx;
		font-weight: 400;
	}

	.buyOffline_fd3_0_c0_c2_c0 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/693.png) no-repeat;
		height: 71rpx;
		width: 191rpx;
		margin: 0rpx 16rpx 0rpx 0rpx;
		background-size: 100% auto;
	}

	.buyOffline_fd3_0_c0_c2 {
		margin: 0rpx 0rpx 70rpx 0rpx;
	}

	.buyOffline_fd3_0_c0_c1 {
		line-height: 44rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
		margin: 40rpx 0rpx 35rpx 0rpx;
		text-align: center;
	}

	.buyOffline_fd3_0_c0_c0 {
		color: #333333;
		font-size: 40rpx;
		font-weight: 400;
		margin: 190rpx 0rpx 0rpx 0rpx;
	}

	.buyOffline_fd3_0 {
		background: url(https://www.guochaoxiaoju.com/uploads/mini/692.png) no-repeat;
		width: 580rpx;
		background-size: 100% auto;
	}
</style>

<style>
	page {
		font-family: Alimama DongFangDaKai;
	}
</style>